<template>
<div>
  <div id="top">
    <div id="topBar">
      <router-link :to="{name:'principle'}"><van-icon name="arrow-left" style="float: left;margin-top: 0.5rem;margin-left: 0.5rem"/>
      <p style="float: left">领积分</p></router-link>
      <router-link :to="{name:'pointsRecord'}"><p style="float: right;color: #39a9ed;margin-right: 0.5rem" >积分记录</p></router-link>
    </div>
    <div id="points">
      <p id="pointsNum">
     {{points}}
      </p>
      <router-link :to="{path:'/getPoints/pointsIntroduction'}"><p id="pointsIntroduction">积分说明</p></router-link>
    </div>
    <ul id="greenTravelAndTask">
      <li :class="{'active':greenTravel}" @click="change(1)">绿色出行</li>
      <li :class="{'active':task}" @click="change(2)">领任务获积分</li>
    </ul>

  </div>
  <div id="footOne" v-bind:style="{display:footOne}">
    <div id="subway">
    <div class="left">

    </div>
      <div class="right">
      <div class="getPoints">
        <p class="time">
        {{bustime}}
        </p>
        <van-button plain type="info" style="border-radius: 0.5rem;margin-top:0.5rem;font-size: 0.9rem" size="small">点击领取</van-button>
      </div>
      <div class="getPoints">
        <p class="time">
          {{bustime}}
        </p>
        <van-button plain type="info" style="border-radius: 0.5rem;margin-top:0.5rem;font-size: 0.9rem" size="small">点击领取</van-button>
      </div>
      </div>
    </div>
    <div id="pic">
    </div>
   <div id="bus">
     <div class="left">

     </div>
     <div class="right">
       <div class="getPoints">
         <p class="time">
           {{bustime}}
         </p>
         <van-button plain type="info" style="border-radius: 0.5rem;margin-top:0.5rem;font-size: 0.9rem" size="small">点击领取</van-button>
       </div>
       <div class="getPoints">
         <p class="time">
           {{bustime}}
         </p>
         <van-button plain type="info" style="border-radius: 0.5rem;margin-top:0.5rem;font-size: 0.9rem" size="small">点击领取</van-button>
       </div>
     </div>
   </div>
   </div>
  <div id="footTwo" v-bind:style="{display:footTwo}">
  <div class="subject">
    <p>
      安全常识答题
    </p>
    <router-link :to="{name:'questionOfSafety'}">
      <van-button plain type="info" style="border-radius: 0.5rem;margin-top:0.5rem;font-size: 0.9rem;width:5rem;float: right" size="small">
        领取
      </van-button>
    </router-link>
  </div>
    <div class="subject">
      <p>
        浏览公益广告
      </p>
      <van-button plain type="info" style="border-radius: 0.5rem;margin-top:0.5rem;font-size: 0.9rem;width:5rem;float: right" size="small">领取</van-button>
    </div>
  </div>
  </div>

</div>
</template>

<script>
    export default {
        name: "getPoints",
      data(){
          return{
            footOne:"",
            footTwo:"none",
            points:2000000,
            greenTravel:true,
            task:false,
            bustime:"12月14日13：00"
          }
      },
      methods:{
        change(num){
          if(num==1){
            this.greenTravel=true
            this.task=false
            this.footOne=""
            this.footTwo="none"
          }else if (num==2){
            this.greenTravel=false
            this.task=true
            this.footOne="none"
            this.footTwo=""
          }
        }
      }
    }
</script>

<style scoped>
  #top{
    width: 100%;
    height:14rem;
    background: red;
    overflow: hidden;
    position: relative;
  }
  #topBar{
    height: 2rem;
    width: 100%;
    line-height: 2rem;
    background: papayawhip;
    color:black;
    font-size: 1rem;
    margin-top: 1rem;
  }
  #topBar p{
    display: inline-block;
  }
  #points{
    width: 100%;
    height: 6.5rem;
    background: #999999;
    margin-top: 1rem;
    position: relative;
  }
  #points #pointsNum{
   height: 6rem;
    width: 6rem;
    line-height: 6rem;
    font-weight: bold;
    font-size: 1rem;
    border: 0.1rem solid #39a9ed;
    border-radius: 50%;
    margin: 0 auto;
    color: #39a9ed;
    background: cadetblue;
  }
  #pointsIntroduction{
    position: absolute;
    display: inline-block;
    font-size: 0.8rem;
    background: papayawhip;
    right: 2.8rem;
    bottom: 1rem;
    color: #39a9ed;
  }
  #greenTravelAndTask{
    height: 2rem;
    background: bisque;
    position: absolute;
    bottom: 0;
    width: 100%;
    border-bottom: #999999 solid 0.15rem;
  }
  #greenTravelAndTask>li{
    height: 2rem;
    width: 50%;
    float: left;
    font-size: 1rem;
    line-height: 2rem;
  }
  .active{
    border-bottom :#39a9ed solid 0.15rem;
    color:#39a9ed;
  }

  #subway,#bus{
    width: 100%;
    height:13rem;
    background: palegoldenrod;
    overflow: hidden;
    position: relative;
  }
  .left{
    display: inline-block;
    height: 100%;
    width: 7rem;
    background: #39a9ed;
    float: left;
    margin-left: 1rem;
  }
  .right{
    display: inline-block;
    height: 100%;
    width: 13rem;
    float: right;
    background: #39a9ed;
    padding-right: 1rem;

  }
  .getPoints{
    display: inline-block;
    height: 3rem;
    width: 100%;
    border: #39a9ed 0.1rem dotted;
    border-radius: 0.5rem;
    background:goldenrod;
    margin-top: 2rem;
  }
  .time{
    display: inline-block;
    height: 100%;
    width:7rem;
    background: #999999;
    float: left;
    font-size: 0.8rem;
   line-height: 3rem;
  }
  #pic {
    height: 4.5rem;
    width: 100%;
    background:url("https://img.yzcdn.cn/vant/apple-1.jpg") center center no-repeat;
    background-size: cover;
  }
  #footTwo{
    padding: 2rem 1rem 0 1rem;
    background:pink;
    width: 100%;
    height: 10rem;
    box-sizing: border-box;
  }
  .subject:first-child{
    border-bottom: none;
  }
  .subject{
    width: 100%;
    border: #39a9ed dotted 0.25rem;
    padding: 0 1rem;
    box-sizing: border-box;
    height: 3rem;
    background:royalblue;

  }
  .subject p{
    display: inline-block;
    line-height: 2.5rem;
    font-size: 1rem;
    color: #39a9ed;
    float: left;
    margin-left: 1rem;
  }

</style>
